package windbell.domain.risk;

import edu.fudan.mylang.pf.query.BaseStatCriteria;
import java.util.Collection;
import windbell.domain.risk.RiskMonthStatData;

public class RiskMonthStat extends BaseStatCriteria<RiskMonthStatData> {
  public void initOrderBys() {
    
  }
  
  public Collection<RiskMonthStatData> list() {
    criteria.postInitialize();
    initOrderBys();
    String aggrCriteria = " select new windbell.domain.risk.RiskMonthStatData(this.derived.foundDateFragment.absMonth,count(this.id))"
    		+ criteria.getHQLFrom() + " " + criteria.getHQLBodyWithActiveCondition();
    aggrCriteria += " group by this.derived.foundDateFragment.absMonth ";
    aggrCriteria += buildOrderByString();
    org.hibernate.Query query = entities.createQuery(aggrCriteria);
    criteria.fillParameters(query);
    return doList(query);
    
  }
}
